package com.muyu.remote.factory;

import com.muyu.common.core.domain.Result;
import com.muyu.danmo.domain.DanmoAddresses;
import com.muyu.remote.RemoteAddressesService;
import org.springframework.cloud.openfeign.FallbackFactory;

public class RemoteAddressesFactory  implements FallbackFactory<RemoteAddressesService> {


    @Override
    public RemoteAddressesService create(Throwable cause) {
        return new RemoteAddressesService() {
            @Override
            public Result list(DanmoAddresses danmoAddresses) {
                System.out.println("远程调用失败"+cause.getCause());
                return Result.success(cause.getCause());
            }
        };
    }
}
